/********************************************************
Project name: OOP - Home Assignment no. 3

Authors: Rami Berkovsky
         Ofir Cohen

File name: Dispatcher.cpp

Purpose: This class contains the Dispatcher implementation

********************************************************/

#include "Dispatcher.h"
#include <queue>


// execute all commands in queue
void Dispatcher::Execute_command() {
	while (myQueue.size() > 0)
	{
		myQueue.front()->Execute();
        delete myQueue.front();
		myQueue.pop();
	}
}

// clears all commands from the queue
void Dispatcher::Clear_queue() {
	while (myQueue.size() > 0)
    {
        delete myQueue.front();
		myQueue.pop();
    }
}
